<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是LCD应用编程——显示JPEG图片的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV18-01-LCD应用编程-04-显示JPEG图片">
<meta property="og:url" content="https://sumumm.github.io/post/988c7ee6.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是LCD应用编程——显示JPEG图片的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091233253.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091642786.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091941704.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092354247.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092833361.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092936046.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093022009.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093248880.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093344805.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093523152.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013094520195.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013094701984.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013095131896.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100606133.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100702438.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100942668.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013105911586.png">
<meta property="article:published_time" content="2024-10-27T11:29:42.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.035Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="(ALPHA)LV03-应用开发">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091233253.png">


<link rel="canonical" href="https://sumumm.github.io/post/988c7ee6.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":"","permalink":"https://sumumm.github.io/post/988c7ee6.html","path":"post/988c7ee6.html","title":"LV18-01-LCD应用编程-04-显示JPEG图片"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV18-01-LCD应用编程-04-显示JPEG图片 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81JPEG%E7%AE%80%E4%BB%8B"><span class="nav-text">一、JPEG简介</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81libjpeg-%E7%AE%80%E4%BB%8B"><span class="nav-text">二、libjpeg 简介  </span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%AE%80%E4%BB%8B"><span class="nav-text">1. 简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E7%A7%BB%E6%A4%8DlibJpeg%E5%BA%93"><span class="nav-text">2. 移植libJpeg库</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E6%BA%90%E7%A0%81%E4%B8%8B%E8%BD%BD"><span class="nav-text">2.1 源码下载</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E7%BC%96%E8%AF%91%E6%BA%90%E7%A0%81"><span class="nav-text">2.2 编译源码</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E5%AE%89%E8%A3%85%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6%E5%A4%B9%E7%AE%80%E4%BB%8B"><span class="nav-text">3. 安装目录文件夹简介</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-include"><span class="nav-text">3.1 include</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-lib%E7%9B%AE%E5%BD%95"><span class="nav-text">3.2 lib目录</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E6%8B%B7%E8%B4%9D%E5%88%B0%E5%85%B1%E4%BA%AB%E7%9B%AE%E5%BD%95"><span class="nav-text">4. 拷贝到共享目录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E7%A7%BB%E6%A4%8D%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF"><span class="nav-text">5. 移植到开发板</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81libjpeg-%E7%9A%84%E4%BD%BF%E7%94%A8"><span class="nav-text">三、libjpeg 的使用</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-libjpeg-%E8%A7%A3%E7%A0%81%E5%9F%BA%E6%9C%AC%E6%B5%81%E7%A8%8B"><span class="nav-text">1.  libjpeg 解码基本流程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86"><span class="nav-text">2. 错误处理  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E5%88%9B%E5%BB%BA%E8%A7%A3%E7%A0%81%E5%AF%B9%E8%B1%A1"><span class="nav-text">3. 创建解码对象  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E8%AE%BE%E7%BD%AE%E6%95%B0%E6%8D%AE%E6%BA%90"><span class="nav-text">4. 设置数据源  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E8%AF%BB%E5%8F%96-jpeg-%E6%96%87%E4%BB%B6%E7%9A%84%E5%A4%B4%E4%BF%A1%E6%81%AF"><span class="nav-text">5. 读取 jpeg 文件的头信息  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-%E8%AE%BE%E7%BD%AE%E8%A7%A3%E7%A0%81%E5%A4%84%E7%90%86%E5%8F%82%E6%95%B0"><span class="nav-text">6. 设置解码处理参数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-%E5%BC%80%E5%A7%8B%E8%A7%A3%E7%A0%81"><span class="nav-text">7. 开始解码  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-%E8%AF%BB%E5%8F%96%E6%95%B0%E6%8D%AE"><span class="nav-text">8. 读取数据  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9-%E7%BB%93%E6%9D%9F%E8%A7%A3%E7%A0%81"><span class="nav-text">9. 结束解码  </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#10-%E9%87%8A%E6%94%BE-%E9%94%80%E6%AF%81%E8%A7%A3%E7%A0%81%E5%AF%B9%E8%B1%A1"><span class="nav-text">10. 释放&#x2F;销毁解码对象  </span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E6%98%BE%E7%A4%BA%E5%AE%9E%E4%BE%8B"><span class="nav-text">四、显示实例</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/988c7ee6.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV18-01-LCD应用编程-04-显示JPEG图片 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV18-01-LCD应用编程-04-显示JPEG图片
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-10-27 19:29:42" itemprop="dateCreated datePublished" datetime="2024-10-27T19:29:42+08:00">2024-10-27</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/" itemprop="url" rel="index"><span itemprop="name">02IMX6ULL平台</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">LV03-应用开发</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>6.8k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>25 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是LCD应用编程——显示JPEG图片的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" rowspan="5">PC端开发环境</td>        <td align="center" width=150px>Windows</td>        <td align="left">Windows11</td>    </tr>    <tr>        <td align="center">Ubuntu</td>        <td align="left">Ubuntu20.04.2的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 17 Pro</td>        <td align="left">17.6.0 build-24238078</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>    </tr>    <tr>        <td align="center">Win32DiskImager</td>        <td align="left">Win32DiskImager v1.0</td>      </tr>    <tr>        <td align="center" rowspan="3">Linux开发板环境</td>        <td align="center">Linux开发板</td>        <td align="left">正点原子 i.MX6ULL Linux 阿尔法开发板</td>      </tr>    <tr>        <td align="center">uboot</td>        <td align="left">NXP官方提供的uboot，NXP提供的版本为uboot-imx-rel_imx_4.1.15_2.1.0_ga(使用的uboot版本为U-Boot 2016.03)</td>      </tr>    <tr>        <td align="center">linux内核</td>        <td align="left">linux-4.15(NXP官方提供)</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="5">官方网站</td>        <td align="left"><a href="https://www.arm.com/" target="_blank">https://www.arm.com/</a></td>        <td align="left">ARM官方网站，在这里我们可以找到Cotex-Mx以及ARMVx的一些文档</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxp.com.cn/" target="_blank">https://www.nxp.com.cn/ </a></td>        <td align="left">NXP官方网站</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxpic.org.cn/" target="_blank">https://www.nxpic.org.cn/</a></td><td align="left">NXP 官方社区</td>    </tr>    <tr>        <td align="left"><a href="https://u-boot.readthedocs.io/en/latest/" target="_blank">https://u-boot.readthedocs.io/en/latest/</a></td><td align="left">u-boot官网</td>    </tr>    <tr>        <td align="left"><a href="https://www.kernel.org/" target="_blank">https://www.kernel.org/</a></td><td align="left">linux内核官网</td>    </tr>    <tr>        <td align="center" rowspan="5">其他网站</td>        <td align="left"><a href="https://elixir.bootlin.com/linux/v4.15/source/kernel" target="_blank">kernel - Linux source code (v4.15) - Bootlin</a></td>        <td align="left">linux内核源码在线查看</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="4">NXP</td>        <td align="left"><a href="https://github.com/nxp-imx" target="_blank">https://github.com/nxp-imx</a></td>        <td align="left">NXP imx开发资源GitHub组织，里边会有u-boot和linux内核的仓库</td>    </tr>    <tr>        <td align="left"><a href="https://elixir.bootlin.com/linux/latest/source" target="_blank">https://elixir.bootlin.com/linux/latest/source</a></td>        <td align="left">在线阅读linux kernel源码</td>    </tr>    <tr>        <td align="left"><a href="https://github.com/nxp-imx/linux-imx/releases/tag/rel_imx_4.1.15_2.1.0_ga" target="_blank">nxp-imx/linux-imx/releases/tag/rel_imx_4.1.15_2.1.0_ga</a></td>        <td align="left">NXP linux内核仓库tags中的rel_imx_4.1.15_2.1.0_ga</td>    </tr>    <tr>        <td align="left"><a href="https://github.com/nxp-imx/uboot-imx/releases/tag/rel_imx_4.1.15_2.1.0_ga" target="_blank">nxp-imx/uboot-imx/releases/tag/rel_imx_4.1.15_2.1.0_ga</a></td>        <td align="left">NXP u-boot仓库tags中的rel_imx_4.1.15_2.1.0_ga</td>    </tr>    <tr>        <td align="center" rowspan="2">I.MX6ULL</td>        <td align="left"><a href="https://www.nxp.com.cn/docs/en/data-sheet/IMX6ULLIEC.pdf" target="_blank">i.MX 6ULL Applications Processors for Industrial Products</a></td>        <td align="left">I.MX6ULL 芯片手册（datasheet，可以在线查看）</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxp.com.cn/webapp/Download?colCode=IMX6ULLRM&lang_cd=zh" target="_blank">i.MX 6ULL Applications ProcessorReference Manual</a></td>        <td align="left">I.MX6ULL 参考手册（下载后才能查看，需要登录NXP官网）</td>    </tr></table>
              </div>
            </details>

<h1 id="一、JPEG简介"><a href="#一、JPEG简介" class="headerlink" title="一、JPEG简介"></a><font size=3>一、JPEG简介</font></h1><p>JPEG（Joint Photographic Experts Group）是由国际标准组织为静态图像所建立的第一个国际数字图像压缩标准，也是至今一直在使用的、应用最广的图像压缩标准。</p>
<p>JPEG 由于可以提供有损压缩，因此压缩比可以达到其他传统压缩算法无法比拟的程度； JPEG 虽然是有损压缩，但这个损失的部分是人的视觉不容易察觉到的部分，它充分利用了人眼对计算机色彩中的高频信息部分不敏感的特点，来大大节省了需要处理的数据信息。</p>
<p>JPEG 压缩文件通常以.jpg 或.jpeg 作为文件后缀名， 关于 JPEG 压缩标准这里就写这么多，其他方面更详细的可以看音视频那部分的笔记：</p>
<blockquote>
<ul>
<li>01嵌入式开发&#x2F;04音视频&#x2F;LV01-图像基础知识&#x2F;LV01-图像-03-图片格式-03-01-JPEG基础.md</li>
<li>01嵌入式开发&#x2F;04音视频&#x2F;LV01-图像基础知识&#x2F;LV01-图像-03-图片格式-03-02-JPEG编解码.md</li>
<li>01嵌入式开发&#x2F;04音视频&#x2F;LV01-图像基础知识&#x2F;LV01-图像-03-图片格式-03-03-JPEG协议介绍.md</li>
<li>01嵌入式开发&#x2F;04音视频&#x2F;LV01-图像基础知识&#x2F;LV01-图像-03-图片格式-03-04-JPEG中的Exif文件格式标准.md</li>
</ul>
</blockquote>
<h1 id="二、libjpeg-简介"><a href="#二、libjpeg-简介" class="headerlink" title="二、libjpeg 简介  "></a><font size=3>二、libjpeg 简介  </font></h1><h2 id="1-简介"><a href="#1-简介" class="headerlink" title="1. 简介"></a><font size=3>1. 简介</font></h2><p>JPEG 压缩标准使用了一套压缩算法对原始图像数据进行了压缩得到.jpg 或.jpeg 图像文件，如果想要在LCD 上显示.jpg 或.jpeg 图像文件，则需要对其进行解压缩、以得到图像的原始数据，如 RGB 数据。可以分为软解和硬解，硬解就是硬件JPEG解码器去解码，但是imx6ull中没有这样的解码器，所以这里我们了解一下软解。</p>
<p>既然压缩过程使用了算法，那对.jpg 或.jpeg 图像文件进行解压同样也需要算法来处理，我们不需要自己去造轮子写这样一个算法，感觉还是很麻烦的，我们可以使用别人写好的库、调用别人写好的库函数来解压.jpg 或.jpeg 图像文件。</p>
<p>libjpeg 是一个完全用 C 语言编写的函数库，包含了 JPEG 解码（解压缩） 、 JPEG 编码（创建压缩） 和其他的 JPEG 功能的实现。 可以使用 libjpeg 库对.jpg 或.jpeg 压缩文件进行解压或者生成.jpg 或.jpeg 压缩文件。</p>
<p>libjpeg 是一个开源 C 语言库，它的官网在这里：<a target="_blank" rel="noopener" href="https://libjpeg.sourceforge.net/">libjpeg (sourceforge.net)</a>（感觉应该是这个吧）</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091233253.png" alt="image-20241013091233253" style="zoom:50%;" />

<h2 id="2-移植libJpeg库"><a href="#2-移植libJpeg库" class="headerlink" title="2. 移植libJpeg库"></a><font size=3>2. 移植libJpeg库</font></h2><h3 id="2-1-源码下载"><a href="#2-1-源码下载" class="headerlink" title="2.1 源码下载"></a><font size=3>2.1 源码下载</font></h3><p>我们打开这个网址：<a target="_blank" rel="noopener" href="http://www.ijg.org/files/">Directory Listing of &#x2F;files (ijg.org)</a>，我这里直接选最新的v9f版本：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091642786.png" alt="image-20241013091642786" style="zoom:50%;" />

<p>下载完进行解压：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar xf jpegsrc.v9f.tar.gz</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013091941704.png" alt="image-20241013091941704" style="zoom:50%;" />

<p>解压完我们会得到如下文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092354247.png" alt="image-20241013092354247" style="zoom:50%;" />

<p>还有很多，这里没截全。</p>
<h3 id="2-2-编译源码"><a href="#2-2-编译源码" class="headerlink" title="2.2 编译源码"></a><font size=3>2.2 编译源码</font></h3><ul>
<li>创建一个安装目录</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd ~/9arm-linux-lib/jpeg-9f/</span><br><span class="line">mkdir jpeg_lib_out</span><br></pre></td></tr></table></figure>

<ul>
<li>配置工程</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./configure --host=arm-linux-gnueabihf --prefix=/home/sumu/9arm-linux-lib/jpeg-9f/jpeg_lib_out</span><br></pre></td></tr></table></figure>

<p>我们可以执行.&#x2F;configure –help 查看它的配置选项以及含义， –host 选项用于指定交叉编译得到的库文件是运行在哪个平台，通常将–host 设置为交叉编译器名称的前缀，如 arm-linux-gnueabihf-gcc 前缀就是 arm-linux-gnueabihf； –prefix 选项则用于指定库文件的安装路径， 将家目录下的 9arm-linux-lib&#x2F;jpeg-9f&#x2F; 目录作为libjpeg 的安装目录。  配置完毕如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092833361.png" alt="image-20241013092833361" style="zoom:50%;" />

<ul>
<li>编译</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make</span><br></pre></td></tr></table></figure>

<p>编译完成如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013092936046.png" alt="image-20241013092936046" style="zoom:50%;" />

<ul>
<li>安装libjpeg</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make install</span><br></pre></td></tr></table></figure>

<p>安装完毕如下所示，一般都不会有什么大问题：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093022009.png" alt="image-20241013093022009" style="zoom:50%;" />

<ul>
<li>查看生成的文件</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">sumu@sumu-virtual-machine:~/9arm-linux-lib/jpeg-9f/jpeg_lib_out$ cd ~/9arm-linux-lib/jpeg-9f/jpeg_lib_out</span><br><span class="line">sumu@sumu-virtual-machine:~/9arm-linux-lib/jpeg-9f/jpeg_lib_out$ tree</span><br><span class="line">.</span><br><span class="line">├── bin</span><br><span class="line">│   ├── cjpeg</span><br><span class="line">│   ├── djpeg</span><br><span class="line">│   ├── jpegtran</span><br><span class="line">│   ├── rdjpgcom</span><br><span class="line">│   └── wrjpgcom</span><br><span class="line">├── include</span><br><span class="line">│   ├── jconfig.h</span><br><span class="line">│   ├── jerror.h</span><br><span class="line">│   ├── jmorecfg.h</span><br><span class="line">│   └── jpeglib.h</span><br><span class="line">├── lib</span><br><span class="line">│   ├── libjpeg.a</span><br><span class="line">│   ├── libjpeg.la</span><br><span class="line">│   ├── libjpeg.so -&gt; libjpeg.so.9.6.0</span><br><span class="line">│   ├── libjpeg.so.9 -&gt; libjpeg.so.9.6.0</span><br><span class="line">│   ├── libjpeg.so.9.6.0</span><br><span class="line">│   └── pkgconfig</span><br><span class="line">│       └── libjpeg.pc</span><br><span class="line">└── share</span><br><span class="line">    └── man</span><br><span class="line">        └── man1</span><br><span class="line">            ├── cjpeg.1</span><br><span class="line">            ├── djpeg.1</span><br><span class="line">            ├── jpegtran.1</span><br><span class="line">            ├── rdjpgcom.1</span><br><span class="line">            └── wrjpgcom.1</span><br><span class="line"></span><br><span class="line">7 directories, 20 files</span><br></pre></td></tr></table></figure>

<h2 id="3-安装目录文件夹简介"><a href="#3-安装目录文件夹简介" class="headerlink" title="3. 安装目录文件夹简介"></a><font size=3>3. 安装目录文件夹简介</font></h2><p>我们可以看一下上面安装完成后的目录：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093248880.png" alt="image-20241013093248880" style="zoom:50%;" />

<p>bin 目录下包含一些测试工具；include 目录下包含头文件； lib 目录下包含动态链接库文件。  </p>
<h3 id="3-1-include"><a href="#3-1-include" class="headerlink" title="3.1 include"></a><font size=3>3.1 include</font></h3><p>我们看一下include目录：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093344805.png" alt="image-20241013093344805" style="zoom:50%;" />

<p>可以看到有4个头文件，我们编程的时候只需要包含jpeglib.h  就可以了。</p>
<h3 id="3-2-lib目录"><a href="#3-2-lib目录" class="headerlink" title="3.2 lib目录"></a><font size=3>3.2 lib目录</font></h3><p>我们看一下lib目录：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013093523152.png" alt="image-20241013093523152" style="zoom:50%;" />

<p>其中的libjpeg.so 和 libjpeg.so.9 都是符号链接，指向 libjpeg.so.9.2.0。  所以在拷贝到windows目录（主要是可能会出现在共享目录）的时候要格外注意。</p>
<h2 id="4-拷贝到共享目录"><a href="#4-拷贝到共享目录" class="headerlink" title="4. 拷贝到共享目录"></a><font size=3>4. 拷贝到共享目录</font></h2><p>我把应用层的代码都是放在虚拟机与windows的共享目录中，所以这里要往共享目录拷贝一份，毕竟编译的时候还是要用到库的。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp -avf ~/9arm-linux-lib/jpeg-9f/jpeg_lib_out ~/1sharedfiles/linux_develop/imx6ull-app-demo/lib/jpeg-9f</span><br></pre></td></tr></table></figure>

<p>复制完成后，软连接可能会有问题，我们看一下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013094520195.png" alt="image-20241013094520195" style="zoom:50%;" />

<p>我们可以手动复制两个，重命名下，方便后面使用：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cd ~/1sharedfiles/linux_develop/imx6ull-app-demo/lib/jpeg-9f/lib</span><br><span class="line">cp libjpeg.so.9.6.0 libjpeg.so.9</span><br><span class="line">cp libjpeg.so.9.6.0 libjpeg.so</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013094701984.png" alt="image-20241013094701984" style="zoom:50%;" />

<h2 id="5-移植到开发板"><a href="#5-移植到开发板" class="headerlink" title="5. 移植到开发板"></a><font size=3>5. 移植到开发板</font></h2><p>接下来就是将安装目录的文件移植到开发板去。我们确保开发板可以挂载开发板的nfs目录，这样我们先将安装目录的文件拷贝到nfs服务器目录去：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp -a jpeg_lib_out ~/4nfs/jpeg-9f</span><br></pre></td></tr></table></figure>

<p>我们看一下文件结构：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">sumu@sumu-virtual-machine:~/9arm-linux-lib/jpeg-9f$ cd ~/4nfs/jpeg-9f/</span><br><span class="line">sumu@sumu-virtual-machine:~/4nfs/jpeg-9f$ tree</span><br><span class="line">.</span><br><span class="line">├── bin</span><br><span class="line">│   ├── cjpeg</span><br><span class="line">│   ├── djpeg</span><br><span class="line">│   ├── jpegtran</span><br><span class="line">│   ├── rdjpgcom</span><br><span class="line">│   └── wrjpgcom</span><br><span class="line">├── include</span><br><span class="line">│   ├── jconfig.h</span><br><span class="line">│   ├── jerror.h</span><br><span class="line">│   ├── jmorecfg.h</span><br><span class="line">│   └── jpeglib.h</span><br><span class="line">├── lib</span><br><span class="line">│   ├── libjpeg.a</span><br><span class="line">│   ├── libjpeg.la</span><br><span class="line">│   ├── libjpeg.so -&gt; libjpeg.so.9.6.0</span><br><span class="line">│   ├── libjpeg.so.9 -&gt; libjpeg.so.9.6.0</span><br><span class="line">│   ├── libjpeg.so.9.6.0</span><br><span class="line">│   └── pkgconfig</span><br><span class="line">│       └── libjpeg.pc</span><br><span class="line">└── share</span><br><span class="line">    └── man</span><br><span class="line">        └── man1</span><br><span class="line">            ├── cjpeg.1</span><br><span class="line">            ├── djpeg.1</span><br><span class="line">            ├── jpegtran.1</span><br><span class="line">            ├── rdjpgcom.1</span><br><span class="line">            └── wrjpgcom.1</span><br><span class="line"></span><br><span class="line">7 directories, 20 files</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>可以看到是没问题的。然后我们在开发板挂载nfs目录：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013095131896.png" alt="image-20241013095131896" />

<p>我们现在需要将jpeg-9f目录中的 bin 目录下的所有测试工具拷贝到开发板 Linux 系统&#x2F;usr&#x2F;bin 目录；将 lib目录下的所有库文件拷贝到开发板 Linux 系统&#x2F;usr&#x2F;lib 目录。  </p>
<p>拷贝 lib 目录下的库文件时，需要注意符号链接的问题， 不能破坏原有的符号链接； 可以将 lib 目录下的所有文件打包成压缩包的形式，如进入到 lib 目录，执行命令：  </p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar -czf lib.tar.gz ./*</span><br></pre></td></tr></table></figure>

<p>但是这里我们是在两个linux系统之间拷贝文件，这里其实不压缩也可以。我们拷贝之前可以先将开发板出厂系统中已经移植的 libjpeg 库删除，在串口终端执行命令 ：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">我们可以先备份一下</span></span><br><span class="line">cd /usr/lib</span><br><span class="line">tar -czf libjpeg.bk.tar.gz libjpeg.*</span><br><span class="line">mv libjpeg.bk.tar.gz ~/nfs_temp/</span><br><span class="line">rm -rf /usr/lib/libjpeg.*</span><br></pre></td></tr></table></figure>

<p>接下来我们开始拷贝文件：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cp -pvf nfs_temp/jpeg-9f/bin/* /usr/bin</span><br><span class="line">cp -avf nfs_temp/jpeg-9f/lib/* /usr/lib</span><br></pre></td></tr></table></figure>

<p>拷贝完毕如下图：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100606133.png" alt="image-20241013100606133" />

<p>我们看一下拷贝过去的软链接是否正常：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ls -alh /usr/lib/libjpeg.*</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100702438.png" alt="image-20241013100702438" />

<p>可以看到都是正常的。</p>
<blockquote>
<p>Tips：注意！当出厂系统原有的 libjpeg 库被删除后，将会导致开发板下次启动后， 出厂系统的 Qt GUI应用程序会出现一些问题，原本显示图片的位置变成了空白，显示不出来了！原因在于 Qt 程序处理图片（对jpeg 图片解码）时，它的底层使用到了 libjpeg 库，而现在我们将出厂系统原有的 libjpeg 库给删除了，自然就会导致 Qt GUI 应用程序中图片显示不出来（无法对 jpeg 图片进行解码） ！这个跟具体的 libjpeg 版本绑定起来的，即使我们将最新编译得到的库文件拷贝到&#x2F;usr&#x2F;lib 目录下，也是无济于事，因为版本不同，想要恢复的话我们可以将之前备份的lib库重新解压即可。  </p>
</blockquote>
<p>然后我们，接着执行 libjpeg 提供的测试工具，看看我们移植成功没：  </p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">djpeg --help</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013100942668.png" alt="image-20241013100942668" />

<p>djpeg 是编译 libjpeg 源码得到的测试工具（在 libjpeg 安装目录下的 lib 目录中） ，当执行命令之后，能够成功打印出这些信息就表示我们的移植成功了！  </p>
<h1 id="三、libjpeg-的使用"><a href="#三、libjpeg-的使用" class="headerlink" title="三、libjpeg 的使用"></a><font size=3>三、libjpeg 的使用</font></h1><h2 id="1-libjpeg-解码基本流程"><a href="#1-libjpeg-解码基本流程" class="headerlink" title="1.  libjpeg 解码基本流程"></a><font size=3>1.  libjpeg 解码基本流程</font></h2><p>libjpeg 提供 JPEG 解码、 JPEG 编码和其他的 JPEG 功能的实现， 这里我们暂时只学习libjpeg 提供的库函数对.jpg&#x2F;.jpeg 进行解码（解压），得到 RGB 数据。  </p>
<p>首先，使用 libjpeg 库需要在我们的应用程序中包含它的头文件 jpeglib.h，该头文件包含了一些结构体数据结构以及 API 接口的申明。 先来看看解码操作的过程：  </p>
<p>（1）、创建 jpeg 解码对象；</p>
<p>（2）、指定解码数据源；</p>
<p>（3）、 读取图像信息；</p>
<p>（4）、设置解码参数；</p>
<p>（5）、开始解码；</p>
<p>（6）、读取解码后的数据；</p>
<p>（7）、解码完毕；  </p>
<p>（8）、释放&#x2F;销毁解码对象。</p>
<p>以上便是整个解码操作的过程， 用 libjpeg 库解码 jpeg 数据的时候，最重要的一个数据结构为 struct jpeg_decompress_struct 结构体，该数据结构记录着 jpeg 数据的详细信息， 也保存着解码之后输出数据的详细信息。 除此之外， 还需要定义一个用于处理错误的对象，错误处理对象是一个 struct jpeg_error_mgr 结构体变量。  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">jpeg_decompress_struct</span> <span class="title">cinfo</span>;</span></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">jpeg_error_mgr</span> <span class="title">jerr</span>;</span></span><br></pre></td></tr></table></figure>

<p>以上就定义了 JPEG 解码对象和错误处理对象。  </p>
<h2 id="2-错误处理"><a href="#2-错误处理" class="headerlink" title="2. 错误处理  "></a><font size=3>2. 错误处理  </font></h2><p>使用 libjpeg 库函数的时候难免会产生错误，所以我们在使用 libjpeg 解码之前，首先要做好错误处理。在 libjpeg 库中，实现了默认错误处理函数，当错误发生时， 例如如果内存不足、文件格式不对等， 则会 libjpeg实现的默认错误处理函数， 默认错误处理函数将会调用 exit()结束束整个进程；当然，我们可以修改错误处理的方式， libjpeg 提供了接口让用户可以注册一个自定义错误处理函数。错误处理对象使用 struct jpeg_error_mgr 结构体描述，该结构体内容如下所示 ：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* Error handler object */</span></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">jpeg_error_mgr</span> &#123;</span></span><br><span class="line">  <span class="comment">/* Error exit handler: does not return to caller */</span></span><br><span class="line">  JMETHOD(<span class="type">noreturn_t</span>, error_exit, (j_common_ptr cinfo));</span><br><span class="line">  <span class="comment">/* Conditionally emit a trace or warning message */</span></span><br><span class="line">  JMETHOD(<span class="type">void</span>, emit_message, (j_common_ptr cinfo, <span class="type">int</span> msg_level));</span><br><span class="line">  <span class="comment">/* Routine that actually outputs a trace or error message */</span></span><br><span class="line">  JMETHOD(<span class="type">void</span>, output_message, (j_common_ptr cinfo));</span><br><span class="line">  <span class="comment">/* Format a message string for the most recent JPEG error or message */</span></span><br><span class="line">  JMETHOD(<span class="type">void</span>, format_message, (j_common_ptr cinfo, <span class="type">char</span> * buffer));</span><br><span class="line"><span class="meta">#<span class="keyword">define</span> JMSG_LENGTH_MAX  200	<span class="comment">/* recommended size of format_message buffer */</span></span></span><br><span class="line">  <span class="comment">/* Reset error state variables at start of a new image */</span></span><br><span class="line">  JMETHOD(<span class="type">void</span>, reset_error_mgr, (j_common_ptr cinfo));</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* The message ID code and any parameters are saved here.</span></span><br><span class="line"><span class="comment">   * A message can have one string parameter or up to 8 int parameters.</span></span><br><span class="line"><span class="comment">   */</span></span><br><span class="line">  <span class="type">int</span> msg_code;</span><br><span class="line"><span class="meta">#<span class="keyword">define</span> JMSG_STR_PARM_MAX  80</span></span><br><span class="line">  <span class="class"><span class="keyword">union</span> &#123;</span></span><br><span class="line">    <span class="type">int</span> i[<span class="number">8</span>];</span><br><span class="line">    <span class="type">char</span> s[JMSG_STR_PARM_MAX];</span><br><span class="line">  &#125; msg_parm;</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* Standard state variables for error facility */</span></span><br><span class="line"></span><br><span class="line">  <span class="type">int</span> trace_level;		<span class="comment">/* max msg_level that will be displayed */</span></span><br><span class="line"></span><br><span class="line">  <span class="comment">/* For recoverable corrupt-data errors, we emit a warning message,</span></span><br><span class="line"><span class="comment">   * but keep going unless emit_message chooses to abort.  emit_message</span></span><br><span class="line"><span class="comment">   * should count warnings in num_warnings.  The surrounding application</span></span><br><span class="line"><span class="comment">   * can check for bad data by seeing if num_warnings is nonzero at the</span></span><br><span class="line"><span class="comment">   * end of processing.</span></span><br><span class="line"><span class="comment">   */</span></span><br><span class="line">  <span class="type">long</span> num_warnings;		<span class="comment">/* number of corrupt-data warnings */</span></span><br><span class="line"></span><br><span class="line">  <span class="comment">/* These fields point to the table(s) of error message strings.</span></span><br><span class="line"><span class="comment">   * An application can change the table pointer to switch to a different</span></span><br><span class="line"><span class="comment">   * message list (typically, to change the language in which errors are</span></span><br><span class="line"><span class="comment">   * reported).  Some applications may wish to add additional error codes</span></span><br><span class="line"><span class="comment">   * that will be handled by the JPEG library error mechanism; the second</span></span><br><span class="line"><span class="comment">   * table pointer is used for this purpose.</span></span><br><span class="line"><span class="comment">   *</span></span><br><span class="line"><span class="comment">   * First table includes all errors generated by JPEG library itself.</span></span><br><span class="line"><span class="comment">   * Error code 0 is reserved for a &quot;no such error string&quot; message.</span></span><br><span class="line"><span class="comment">   */</span></span><br><span class="line">  <span class="type">const</span> <span class="type">char</span> * <span class="type">const</span> * jpeg_message_table; <span class="comment">/* Library errors */</span></span><br><span class="line">  <span class="type">int</span> last_jpeg_message;    <span class="comment">/* Table contains strings 0..last_jpeg_message */</span></span><br><span class="line">  <span class="comment">/* Second table can be added by application (see cjpeg/djpeg for example).</span></span><br><span class="line"><span class="comment">   * It contains strings numbered first_addon_message..last_addon_message.</span></span><br><span class="line"><span class="comment">   */</span></span><br><span class="line">  <span class="type">const</span> <span class="type">char</span> * <span class="type">const</span> * addon_message_table; <span class="comment">/* Non-library errors */</span></span><br><span class="line">  <span class="type">int</span> first_addon_message;	<span class="comment">/* code for first string in addon table */</span></span><br><span class="line">  <span class="type">int</span> last_addon_message;	<span class="comment">/* code for last string in addon table */</span></span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure>

<p>error_exit 函数指针便指向了错误处理函数。使用 libjpeg 库函数 jpeg_std_error()会将 libjpeg 错误处理设置为默认处理方式。如下所示：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//初始化错误处理对象、并将其与解压对象绑定</span></span><br><span class="line">cinfo.err = jpeg_std_error(&amp;jerr);</span><br></pre></td></tr></table></figure>

<p>如果我们要修改默认的错误处理函数，可这样操作：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">void</span> <span class="title function_">my_error_exit</span><span class="params">(<span class="keyword">struct</span> jpeg_decompress_struct *cinfo)</span></span><br><span class="line">&#123;</span><br><span class="line">	<span class="comment">/* ... */</span></span><br><span class="line">&#125;</span><br><span class="line">cinfo.err.error_exit = my_error_exit;</span><br></pre></td></tr></table></figure>

<h2 id="3-创建解码对象"><a href="#3-创建解码对象" class="headerlink" title="3. 创建解码对象  "></a><font size=3>3. 创建解码对象  </font></h2><p>要使用 libjpeg 解码 jpeg 数据，这步是必须要做的。  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_create_decompress(&amp;cinfo);</span><br></pre></td></tr></table></figure>

<p>在创建解码对象之后，如果解码结束或者解码出错时，需要调用 jpeg_destroy_decompress 销毁&#x2F;释放解码对象，否则将会内存泄漏。  </p>
<h2 id="4-设置数据源"><a href="#4-设置数据源" class="headerlink" title="4. 设置数据源  "></a><font size=3>4. 设置数据源  </font></h2><p>就是设置需要进行解码的 jpeg 文件，使用 jpeg_stdio_src()函数设置数据源：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">FILE *jpeg_file = <span class="literal">NULL</span>;</span><br><span class="line"><span class="comment">// 打开.jpeg/.jpg 图像文件</span></span><br><span class="line">jpeg_file = fopen(<span class="string">&quot;./jpeg-853*480.jpg&quot;</span>, <span class="string">&quot;r&quot;</span>); <span class="comment">// 只读方式打开</span></span><br><span class="line"><span class="keyword">if</span> (<span class="literal">NULL</span> == jpeg_file) </span><br><span class="line">&#123;</span><br><span class="line">    perror(<span class="string">&quot;fopen error&quot;</span>);</span><br><span class="line">    <span class="keyword">return</span> <span class="number">-1</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// 指定图像文件</span></span><br><span class="line">jpeg_stdio_src(&amp;cinfo, jpeg_file);</span><br></pre></td></tr></table></figure>

<p>待解码的 jpeg 文件使用标准 I&#x2F;O 方式 fopen 将其打开。 除此之外， jpeg 数据源还可以来自内存中、而不一定的是文件流。  </p>
<h2 id="5-读取-jpeg-文件的头信息"><a href="#5-读取-jpeg-文件的头信息" class="headerlink" title="5. 读取 jpeg 文件的头信息  "></a><font size=3>5. 读取 jpeg 文件的头信息  </font></h2><p>这个和创建解码对象一样，是必须要调用的，是约定。 因为在解码之前，需要读取 jpeg文件的头部信息，以获取该文件的信息，这些获取到的信息会直接赋值给 cinfo 对象的某些成员变量。  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_read_header(&amp;cinfo, TRUE);</span><br></pre></td></tr></table></figure>

<p>调用 jpeg_read_header()后，可以得到 jpeg 图像的一些信息，如 jpeg 图像的宽度、高度、 颜色通道数以及 colorspace 等，这些信息会赋值给 cinfo 对象中的相应成员变量，如下所示：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">cinfo.image_width <span class="comment">//jpeg 图像宽度</span></span><br><span class="line">cinfo.image_height <span class="comment">//jpeg 图像高度</span></span><br><span class="line">cinfo.num_components <span class="comment">//颜色通道数</span></span><br><span class="line">cinfo.jpeg_color_space <span class="comment">//jpeg 图像的颜色空间</span></span><br></pre></td></tr></table></figure>

<p>支持的颜色包括如下几种：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* Known color spaces. */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">enum</span> &#123;</span></span><br><span class="line">	JCS_UNKNOWN,		<span class="comment">/* error/unspecified */</span></span><br><span class="line">	JCS_GRAYSCALE,		<span class="comment">/* monochrome */</span></span><br><span class="line">	JCS_RGB,		<span class="comment">/* red/green/blue, standard RGB (sRGB) */</span></span><br><span class="line">	JCS_YCbCr,		<span class="comment">/* Y/Cb/Cr (also known as YUV), standard YCC */</span></span><br><span class="line">	JCS_CMYK,		<span class="comment">/* C/M/Y/K */</span></span><br><span class="line">	JCS_YCCK,		<span class="comment">/* Y/Cb/Cr/K */</span></span><br><span class="line">	JCS_BG_RGB,		<span class="comment">/* big gamut red/green/blue, bg-sRGB */</span></span><br><span class="line">	JCS_BG_YCC		<span class="comment">/* big gamut Y/Cb/Cr, bg-sYCC */</span></span><br><span class="line">&#125; J_COLOR_SPACE;</span><br></pre></td></tr></table></figure>

<h2 id="6-设置解码处理参数"><a href="#6-设置解码处理参数" class="headerlink" title="6. 设置解码处理参数"></a><font size=3>6. 设置解码处理参数</font></h2><p>在进行解码之前，我们可以对一些解码参数进行设置， 这些参数都有一个默认值，调用jpeg_read_header()函数后，这些参数被设置成相应的默认值。  </p>
<p>直接对 cinfo 对象的成员变量进行修改即可，这里介绍两个比较有代表性的解码处理参数：  </p>
<p>（1）输出的颜色（cinfo.out_color_space）： 默认配置为 RGB 颜色，也就是 JCS_RGB；</p>
<p>（2）图像缩放操作（cinfo.scale_num 和 cinfo.scale_denom）： libjpeg 可以设置解码出来的图像的大小，也就是与原图的比例。使用 scale_num 和 scale_denom 两个参数，解出来的图像大小就是scale_num&#x2F;scale_denom， JPEG 当前仅支持 1&#x2F;1、 1&#x2F;2、 1&#x2F;4、 和 1&#x2F;8 这几种缩小比例。 默认是 1&#x2F;1，也就是保持原图大小。例如要将输出图像设置为原图的 1&#x2F;2 大小，可进行如下设置：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cinfo.scale_num = <span class="number">1</span>;</span><br><span class="line">cinfo.scale_denom = <span class="number">2</span>;</span><br></pre></td></tr></table></figure>

<h2 id="7-开始解码"><a href="#7-开始解码" class="headerlink" title="7. 开始解码  "></a><font size=3>7. 开始解码  </font></h2><p>经过前面的参数设置，我们可以开始解码了，调用 jpeg_start_\decompress()函数：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_start_decompress(&amp;cinfo);</span><br></pre></td></tr></table></figure>

<p>在完成解压缩操作后 ，会将解压后的图像信息填充至 cinfo 结构中。如 ，输出图像宽度cinfo.output_width，输出图像高度cinfo.output_height ，每个像素中的颜色通道数 cinfo.output_components（比如灰度为 1，全彩色 RGB888 为 3）等。  </p>
<p>一般情况下，这些参数是在 jpeg_start_decompress 后才被填充到 cinfo 中的，如果希望在调用<br>jpeg_start_decompress 之前就获得这些参数，可以通过调用 jpeg_calc_output_dimensions()的方法来实现。  </p>
<h2 id="8-读取数据"><a href="#8-读取数据" class="headerlink" title="8. 读取数据  "></a><font size=3>8. 读取数据  </font></h2><p>接下来就可以读取解码后的数据了， 数据是按照行读取的， 解码后的数据按照从左到右、 从上到下的顺序存储，每个像素点对应的各颜色或灰度通道数据是依次存储， 例如一个 24-bit RGB 真彩色的图像中，一行的数据存储模式为 B,G,R,B,G,R,B,G,R,…。  </p>
<p>libjpeg 默认解码得到的图像数据是 BGR888 格式，即 R 颜色在低 8 位、而 B 颜色在高 8 位。 可以定义一个 BGR888 颜色类型，如下所示：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> <span class="title">bgr888_color</span> &#123;</span></span><br><span class="line">    <span class="type">unsigned</span> <span class="type">char</span> red;</span><br><span class="line">    <span class="type">unsigned</span> <span class="type">char</span> green;</span><br><span class="line">    <span class="type">unsigned</span> <span class="type">char</span> blue;</span><br><span class="line">&#125; __attribute__ ((packed)) <span class="type">bgr888_t</span>;</span><br></pre></td></tr></table></figure>

<p>每次读取一行数据， 计算每行数据需要的空间大小，比如 RGB 图像就是宽度 x 3（24-bit RGB 真彩色一个像素 3 个字节） ，灰度图就是宽度x1（一个像素 1 个字节）。  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">bgr888_t</span> *line_buf = <span class="built_in">malloc</span>(cinfo.output_width * cinfo.output_components);</span><br></pre></td></tr></table></figure>

<p>以上我们分配了一个行缓冲区，它的大小为 cinfo.output_width * cinfo.output_components，也就是输出图像的宽度乘上每一个像素的字节大小。 我们除了使用 malloc 分配缓冲区外，还可以使用 libjpeg 的内存管理器来分配缓冲区。</p>
<p>缓冲区分配好之后，接着可以调用 jpeg_read_scanlines()来读取数据， jpeg_read_scanlines()可以指定一次读多少行，但是目前该函数还只能支持一次只读 1 行；函数如下所示：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_read_scanlines(&amp;cinfo, &amp;buf, <span class="number">1</span>);</span><br></pre></td></tr></table></figure>

<p>1 表示每次读取的行数，通常都是将其设置为 1。 cinfo.output_scanline 表示接下来要读取的行对应的索引值， 初始化为 0（表示第一行）、 1 表示第二行等，每读取一行数据，该变量就会加 1，所以我们可以通过下面这种循环方式依次读取解码后的所有数据：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">while</span>(cinfo.output_scanline &lt; cinfo.output_height)</span><br><span class="line">&#123;</span><br><span class="line">    jpeg_read_scanlines(&amp;cinfo, buffer, <span class="number">1</span>);</span><br><span class="line">    <span class="comment">//do something</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>读取一行数据就可以送到显示屏进行显示了，但是需要注意的是，解码后的数据是RGB888的格式，但是正点原子出厂系统设置LCD为RGB565格式，所以这里还需要做一个转换：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">define</span> argb8888_to_rgb565(color)   (&#123; \</span></span><br><span class="line"><span class="meta">            unsigned int temp = (color); \</span></span><br><span class="line"><span class="meta">            ((temp &amp; 0xF80000UL) &gt;&gt; 8) | \</span></span><br><span class="line"><span class="meta">            ((temp &amp; 0xFC00UL) &gt;&gt; 5) | \</span></span><br><span class="line"><span class="meta">            ((temp &amp; 0xF8UL) &gt;&gt; 3); \</span></span><br><span class="line"><span class="meta">            &#125;)</span></span><br></pre></td></tr></table></figure>

<h2 id="9-结束解码"><a href="#9-结束解码" class="headerlink" title="9. 结束解码  "></a><font size=3>9. 结束解码  </font></h2><p>解码完毕之后调用 jpeg_finish_decompress()函数：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_finish_decompress(&amp;cinfo);</span><br></pre></td></tr></table></figure>

<h2 id="10-释放-销毁解码对象"><a href="#10-释放-销毁解码对象" class="headerlink" title="10. 释放&#x2F;销毁解码对象  "></a><font size=3>10. 释放&#x2F;销毁解码对象  </font></h2><p>当解码完成之后，我们需要调用 jpeg_destroy_decompress()函数销毁&#x2F;释放解码对象：  </p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jpeg_destroy_decompress(&amp;cinfo);</span><br></pre></td></tr></table></figure>

<h1 id="四、显示实例"><a href="#四、显示实例" class="headerlink" title="四、显示实例"></a><font size=3>四、显示实例</font></h1><p>代码和Makefile以及实例图片都在这里：<a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-app-demo/tree/master/LV18_LCD_DEVICE/05_lcd_show_jpeg">LV18_LCD_DEVICE&#x2F;05_lcd_show_jpeg · 苏木&#x2F;imx6ull-app-demo - 码云 - 开源中国 (gitee.com)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/LV18-01-LCD%E5%BA%94%E7%94%A8%E7%BC%96%E7%A8%8B-04-%E6%98%BE%E7%A4%BAJPEG%E5%9B%BE%E7%89%87/img/image-20241013105911586.png" alt="image-20241013105911586" />

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/988c7ee6.html">LV18-01-LCD应用编程-04-显示JPEG图片</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年10月27日 - 19:29</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/988c7ee6.html" title="LV18-01-LCD应用编程-04-显示JPEG图片">https://sumumm.github.io/post/988c7ee6.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/ALPHA-LV03-%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91/" rel="tag"><i class="fa fa-tag"></i> (ALPHA)LV03-应用开发</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/eba3d429.html" rel="prev" title="LV18-01-LCD应用编程-05-显示PNG图片">
                  <i class="fa fa-angle-left"></i> LV18-01-LCD应用编程-05-显示PNG图片
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/e257ac75.html" rel="next" title="LV18-01-LCD应用编程-03-显示BMP图片">
                  LV18-01-LCD应用编程-03-显示BMP图片 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
